package main

import(
	"fmt"
	"sort"
)

func main() {
	fmt.Println("fxy")
	my01:=[]int {1,2,3,4,5}
	my02:=[]int {6,7,8}
	copy(my01,my02)

	fmt.Println(my01)
	fmt.Println(my02)
		//[6 7 8 4 5]
		//[6 7 8]
	temp:=2
	fmt.Println(my01[:temp])
	fmt.Println(my01[temp+1:])
	my01=append(my01[:temp],my01[temp+1:]...)
	fmt.Println(my01)
	
	my01=my01[1:len(my01)]
	//my01=my01[0:len(my01)-1]
	fmt.Println(my01)
	for _,j:=range my01{
		fmt.Println(j)
	}
	fmt.Println()

	my03:=[5]int {8,9,10,11,12}
	fmt.Println(my03)
	for i:=2;i<len(my03);i++{
		fmt.Println(my03[i])
	}
	fmt.Println()

	var my04 map[int]string = map[int]string{1:"fxy",2:"lingyao",3:"aaa",4:"bbb"}
	fmt.Println(my04[2])
	fmt.Println(my04[1])
	for x,y:=range my04{
		fmt.Println(x,y)
	}
		// run shunxu ????
		//遍历输出元素的顺序与填充顺序无关，不能期望 map 在遍历时返回某种期望顺序的结果。
		//luanxu d 	
	fmt.Println()
	delete(my04,1)
	
	var my05 []string
	for _,y:=range my04{
		my05=append(my05,y)
	}
	fmt.Println(my05)
	sort.Strings(my05)
	fmt.Println(my05)
}
